import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'

import TypeNav from '@/components/common/TypeNav'
import Pagination from '@/components/common/Pagination'

//引入 element-ui
import { MessageBox } from 'element-ui';

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

//将 TypeNav 注册成全局组件
Vue.component(TypeNav.name, TypeNav)
//将 Pagination 注册成全局组件
Vue.component(Pagination.name, Pagination)

// import atm from '@/assets/1.gif'
const loadimage = require('./assets/loading.gif')
//图片懒加载插件
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload,{
  loading: loadimage
})

// import myPlugins from '@/plugins/myPlugins'
// Vue.use(myPlugins, {
//   name:'upper'
// })

import '@/plugins/validate'

import '@/mock/mockServe'

Vue.config.productionTip = false

//引入swiper样式
import 'swiper/css/swiper.css'

import * as API from '@/api'

new Vue({
  router,
  store,
  //配置全局事件总线
  beforeCreate() {
    Vue.prototype.$bus = this
    Vue.prototype.$API = API
  },
  render: h => h(App)
}).$mount('#app')
